#
# WMI - World Model Interpreter
#       WMI provides communication between WM and everything else
#

from math import *

import WM as world

# world = WM.world()		# a world model
home = (0,0)			# standard location
		
def to(loc=None):
	"""Returns a (theta, distance) that defines how we get to loc=(x,y)"""
	if loc == None: loc = self.home
	
	if None in (self.world.context.x, self.world.context.y):
		return (None, None)
	
	return WM.robomath.angle_from_to((self.world.context.x, self.world.context.y), loc), \
		sqrt((self.world.context.x-loc[0])**2+(self.world.context.y-loc[0])**2)
